home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
graphicsUndo.subproj
/
GroupGraphicsChange.m
< prev
next >
Wrap
Text File
|
1992-02-09
|
2KB
|
91 lines
#import "drawundo.h"
@interface GroupGraphicsChange(PrivateMethods)
- undoDetails;
- redoDetails;
@end
@implementation GroupGraphicsChange
- free
{
if (![self hasBeenDone]) {
[[group subGraphics] empty];
[group free];
}
return [super free];
}
- (const char *)changeName
{
return NXLocalStringFromTable("Operations", "Group", NULL, "The operation of grouping a bunch of graphical entities together.");
}
- saveBeforeChange
{
[super saveBeforeChange];
[changeDetails makeObjectsPerform:@selector(recordGraphicPositionIn:) with:[graphicView graphics]];
return self;
}
- changeDetailClass
{
return [OrderChangeDetail class];
}
- noteGroup:aGroup
{
group = aGroup;
return self;
}
- undoDetails
{
int count, i;
id detail, graphic;
List *allGraphics;
allGraphics = [graphicView graphics];
[allGraphics removeObject:group];
count = [changeDetails count];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[graphic setCacheable:YES];
[allGraphics insertObject:graphic at:[detail graphicPosition]];
}
[graphicView getSelection];
[graphicView resetGroupInSlist];
return self;
}
- redoDetails
{
int count, i;
id detail, graphic;
List *selectedGraphics;
List *allGraphics;
selectedGraphics = [graphicView selectedGraphics];
allGraphics = [graphicView graphics];
count = [changeDetails count];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[graphic setCacheable:NO];
[selectedGraphics removeObject:graphic];
[allGraphics removeObject:graphic];
}
[allGraphics insertObject:group at:0];
[graphicView setGroupInSlist:YES];
[graphicView getSelection];
return self;
}
@end